package com.study.system.service.impl;


import com.study.model.book.Book;
import com.study.model.vo.BookQueryVo;
import com.study.system.mapper.BookMapper;
import com.study.system.service.BookService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author biyu0723
 * @since 2022-10-30
 */
@Service
public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements BookService {


    @Override
    public IPage<Book> selectPage(Page<Book> pageParam, BookQueryVo bookQueryVo) {
        return baseMapper.selectPage(pageParam,bookQueryVo);
    }

    @Override
    public void updateStatus(String id, Integer status) {
        Book book =  baseMapper.selectById(id);
        book.setStatus(status);
        baseMapper.updateById(book);

    }
}
